﻿using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace SingletonPattern
{
    class Program
    {
        static void Main(string[] args)
        {
            //调用
            TaskFactory taskFactory = new TaskFactory();
            List<Task> list = new List<Task>();
            for (int i = 0; i < 100; i++)
            {
                list.Add(
                    taskFactory.StartNew(
                       () =>
                       {
                           Singleton singleton = Singleton.CreateInstance();
                       }
                     )
             );

            }

            Console.ReadLine();
        }
    }
}
